package cn.com.cym.gamezao.entity.xmu.recruit;

import cn.com.cym.gamezao.base.BaseEntity;
import cn.com.cym.gamezao.entity.authorize.User;
import cn.com.cym.gamezao.entity.xmu.Recruit;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.NonNull;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;


@Setter
@Getter
@NoArgsConstructor
@Table(name = "x_train_experience")
@Entity
@Accessors(chain = true)
@ApiModel(description = "规培经历")
public class TrainExperience extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -5539590283414395737L;


/*    @ManyToOne
    @JoinColumn(name = "recruit_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Recruit recruit;*/

    @ManyToOne
    @JoinColumn(name = "user_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private User user;

    /**
     * 规培单位
     */
    @Column(length = 48)
    private String trainUnit;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "startDate",value = "开始时间",dataType = "LocalDate")
    @NonNull
    private LocalDate startDate;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "endDate",value = "结束时间",dataType = "LocalDate")
    private LocalDate endDate;

    /**
     * 规培专业
     */
    @Column(length = 48)
    @ApiModelProperty(name = "profession",value = "规培专业",dataType = "String")
    private String profession;

    /**
     * 合格
     */
    @Column(length = 16)
    @ApiModelProperty(name = "qualified",value = "是否合格",dataType = "String")
    private String qualified;

    /**
     * 获取时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "gainDate",value = "获取日期",dataType = "LocalDate")
    private LocalDate gainDate;
}
